#ifndef PACMAN_H
#define PACMAN_H

#include <QMainWindow>
#include<qpainter.h>
#include<QVector>
#include<qstring.h>

QT_BEGIN_NAMESPACE
namespace Ui { class pacman; }
QT_END_NAMESPACE

class pacman : public QMainWindow
{
    Q_OBJECT

public:
    pacman(QWidget *parent = nullptr);
    ~pacman();
    void paintEvent(QPaintEvent *event);
    void Init();
    QRect CreateRectx();
    QRect CreateRecty();

private slots:
    void pacman_update();

private:
    Ui::pacman *ui;
    QRect pac;
    QRect x1[6],y1[6],x2[6],y2[6],x3[6],y3[6],x4[6],y4[6],x5[6],y5[6];
    void keyPressEvent(QKeyEvent *key);
    QTimer *timer;
    bool blsRun;
    bool blsOver;
    QString sDisplay;
    int nDirection;
    int n=0;
};
#endif // PACMAN_H
